import { Link } from '@brillout/docpress'
import { WhyPhoton } from '../../vike-photon/components'
import { BlogHeader } from '../BlogHeader'

<BlogHeader authors={['magne4000', 'brillout']} date={new Date('2025-10-28')} />

Today, we are thrilled to introduce [Photon](https://photonjs.dev) — a next-generation infrastructure for deploying any JavaScript server (Hono, Express.js, Fastify, ...) anywhere (self-hosting, Cloudflare, Vercel, Netlify, ...).

We've also released <Link href="/vike-photon">`vike-photon`</Link> which replaces `vike-server`.

> If you use `vike-server`, we recommend <Link href="/migration/vike-photon">migrating to `vike-photon`</Link>.

Photon is a step towards the future of JavaScript server integration and deployment. See <Link href="#why-photon" />

As a user, the most notable improvement over `vike-server` is the <Link href="#cloudflare">Cloudflare integration</Link>.

## Features

Photon is jam-packed with features:
- **Any server**: Hono, Express.js, Fastify, Elysia, H3, Srvx, Hattip.
- **Any deployment**: Cloudflare, Vercel, self-hosted, and more.
- **HMR**: No more full server reload required.
- **Vite Environment API**: Develop against production runtimes (e.g. Cloudflare's `workerd`).
- **Code-splitting**: Per-route deployment to separate edge workers.
- **Zero-config**: Integrate your server and deployment with minimal configuration.
- **Built-in server**: Photon comes with a built-in server for zero-config use (users can use their own instead).

> Learn more at [`photonjs.dev` > Why Photon > Features](https://photonjs.dev/why#features).

## Cloudflare


When using `@photonjs/cloudflare`, the development environment runs inside Cloudflare's `workerd` runtime (instead of Node.js). It's the same runtime Cloudflare uses in production, making the development environment a much more faithful representation of production.

> Vike is among the first frameworks to support this.
>
> It's powered by <Link href="/blog/vite-6">Vite's Environment API</Link>, which enables Vite to run in a Node.js process while running the user's server code in another (non-Node.js) process such as `workerd`.

It also allows you to directly use Cloudflare's APIs in development. (This was already possible with `getPlatformProxy()` but it was clunky to set up.)

```ts
// This works in production, as well as in development!

import { env } from 'cloudflare:workers'
// Key-value store
env.KV.get('my-key')
// Environment Variable
env.LOG_LEVEL
// ...
```

> Learn more at <Link href="/cloudflare#cloudflare-apis" doNotInferSectionTitle />.

> With Miniflare, discrepancies between development and production led to poor DX, code duplication, and complicated architecture — integrating applications with Cloudflare was notoriously hard. These issues are now solved.

## Why Photon?

[Vite](https://vite.dev) has become the de-facto standard infrastructure shared across many frameworks, and we believe the same will happen for JavaScript server deployment — in one form or another.

Photon aims to be open and collaborative, which is paramount for the community as a whole to move in the right direction (see also [`photonjs.dev` > Why Photon > Philosophy](https://photonjs.dev/why#philosophy)).

> While developing `vike-server` <Link href="/blog/vike-server#sharing-with-other-frameworks">we realized most code is agnostic to Vike</Link>. So we decided to make Vike's deployment infrastructure fully agnostic.
>
> That's what Photon is: it's everything we learned while developing `vike-server`, `vike-cloudflare`, and `vite-plugin-vercel` bundled in one cohesive and agnostic tool with improved DX and new features.

Other than Photon, there are two projects working towards a unified infrastructure:
 - [Nitro](https://nitro.build)
 - [Netlify's RFC](https://github.com/vitejs/vite/discussions/20907)

We are eager to collaborate [with Nitro](https://x.com/brillout/status/1977382732276617245) as well as [with Netlify's RFC](https://github.com/vitejs/vite/discussions/20907#discussioncomment-14739138) — the more we collaborate the better!

These collaboration efforts will take time to come to fruition. In the meantime, Photon is our answer to the shared deployment infrastructure problem and provides a concrete solution for our users.


## The future

We don't know how shared deployment infrastructures will evolve. In our opinion, the best outcome is that we move some — ideally most — of Photon's logic to Vite and its ecosystem (see [Netlify's RFC](https://github.com/vitejs/vite/discussions/20907)).


## See also

- [`photonjs.dev` > Why Photon > Philosophy](https://photonjs.dev/why#philosophy)
- <Link href="/vike-photon" />
- <Link href="/migration/vike-photon" />
- <Link href="/blog/vike-server" />
- <Link href="/blog/vite-6" />
